<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
	
    <h:head>
		<link rel="stylesheet" type="text/css" href="./Styles/present.css" media="screen" />
        <title>ECOM Coloc</title>
    </h:head>
    <h:body>
    <h:form><p:growl id="messages" showSummary="true" showDetail="true" /></h:form>
    <center>
		<table width="1000" bgcolor="#DDECEF" cellspacing="0">
			<!--  Zone logo + login -->
			<tr height="165">
				<td align="center" valign="top" width="250">
					<h:graphicImage value="./Images/Logo.png"/>
				</td>
				<td width="200"></td>
				<td width="200"></td>
				<td width="300">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr height="20">
								<td width="22" background="./Images/menu_hg.jpg"></td>
								<td background="./Images/menu_h.jpg"></td>
								<td width="21" background="./Images/menu_hd.jpg"></td>								
							</tr>
							<tr>
								<td width="22" background="./Images/menu_g.jpg"></td>
								<td bgcolor="#C7AFBD" align="center">
									<h:panelGroup rendered="#{!compteLogin.connecte}">
									<h:form>
										<table border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td align="right"><h:outputText value="Pseudo" /></td>
												<td width="15"></td>
												<td><h:inputText value="#{compteLogin.pseudo}" required="true" id="login" /></td>
											</tr>
											<tr height="5"><td align="right" colspan="3"></td></tr>
											<tr>
												<td align="right"><h:outputText value="Mot de passe" /></td>
												<td width="15"></td>
												<td><h:inputSecret value="#{compteLogin.mdp}" required="true" id="password"/></td>
											</tr>
											<tr height="5"><td align="right" colspan="3"></td></tr>
											<tr>
												<td align="right" colspan="3"><h:commandLink class="menucompte" value="Valider" action="#{compteLogin.login}" /></td>
											</tr>
										</table>
									</h:form>
									<h:form>
										<table>
											<tr>
												<td align="left" colspan="3">
													<h:commandLink class="menucompte" value="Créer un compte" action="CompteNouveau" /><br/>
													<h:commandLink class="menucompte" value="Mot de passe oublié ?" action="ComptePerdu" />
												</td>
											</tr>
										</table>
									</h:form>								
									</h:panelGroup>
									<h:panelGroup rendered="#{compteLogin.connecte}">
									<h:form>
										<h:outputText value="Bonjour #{compteLogin.pseudo}." /><br/><br/>					
										<h:commandLink class="menucompte" value="Modifier mes informations personnelles" action="CompteProprietaireModif" rendered="#{!compteLogin.corp}" />
										<h:commandLink class="menucompte" value="Modifier mes informations personnelles" action="CompteChercheurModif" rendered="#{compteLogin.corp}" />
										<br/>
										<h:commandLink class="menucompte" value="Me deconnecter" action="#{compteLogin.logout}" />
									</h:form>
									</h:panelGroup>							
								</td>
								<td width="21" background="./Images/menu_d.jpg"></td>								
							</tr>
							<tr height="20">
								<td width="22" background="./Images/menu_bg2.jpg"></td>
								<td background="./Images/menu_b2.jpg"></td>
								<td width="21" background="./Images/menu_bd2.jpg"></td>								
							</tr>
						</table>
				</td>
			</tr>
			
			<tr>
				<td align="center" colspan="4" valign="top">
					<table  border="0" width="1000" bgcolor="#F8F2DA" cellspacing="0" cellpadding="0">
						<tr>
							<td align="left" colspan="3" bgcolor="#DDECEF">
 								<ui:insert name="menu">
									<table border="0" cellpadding="0" cellspacing="0" width="100%">
										<tr height="20">
											<td background="./Images/menu_hg.jpg" width="22" />
											<td background="./Images/menu_h.jpg" width="100" />
											<td background="./Images/menu_hm00.jpg" width="40" />
											<td background="./Images/menu_h.jpg" width="190" />
											<td background="./Images/menu_hd.jpg" width="21" />
											<td width="164"/>
											<td background="./Images/menu_hg.jpg" width="22" />
											<td background="./Images/menu_h.jpg" width="105" />
											<td background="./Images/menu_hm00.jpg" width="40" />
											<td background="./Images/menu_h.jpg" width="130" />
											<td background="./Images/menu_hm00.jpg" width="40" />
											<td background="./Images/menu_h.jpg" width="105" />
											<td background="./Images/menu_hd.jpg" width="21" />
										</tr>
										<tr height="35">
											<td background="./Images/menu_g.jpg" width="22" />
											<td bgcolor="#C7AFBD" valign="top" align="center" width="110">
												<a class="menu" href="./AnnoncesRecherche.jsf">Les annonces</a>
											</td>
											<td background="./Images/menu_m00.jpg" width="40" />
											<td bgcolor="#C7AFBD" valign="top" align="center" width="140">
												<h:form>
												<h:commandLink class="menu" value="Passer une annonce" action="compteLogin" rendered="#{!compteLogin.connecte}">
													<f:setPropertyActionListener target="#{compteLogin.page}" value="1" />
												</h:commandLink>
												<h:panelGroup rendered="#{compteLogin.connecte}">
													<h:commandLink class="menu" value="Passer une annonce" action="#{AnnoncesSession.gotoNouvellep}" rendered="#{!compteLogin.corp}" />
													<h:commandLink class="menu" value="Passer une annonce" action="#{AnnoncesSession.gotoNouvellec}" rendered="#{compteLogin.corp}" />
												</h:panelGroup>
												</h:form>
											</td>
											<td background="./Images/menu_d.jpg" width="21" />
											<td />
											<td background="./Images/menu_g.jpg" width="22" />
											<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
												<h:form>
												<h:commandLink class="menu" value="Mes favoris" action="CompteLogin" rendered="#{!compteLogin.connecte}">
													<f:setPropertyActionListener target="#{compteLogin.page}" value="2" />
												</h:commandLink>
												<h:panelGroup rendered="#{compteLogin.connecte}">
													<h:commandLink class="menu" value="Mes favoris" action="AnnoncesProprietaireFavorites" rendered="#{!compteLogin.corp}" />
													<h:commandLink class="menu" value="Mes favoris" action="AnnoncesChercheurFavorites" rendered="#{compteLogin.corp}" />
												</h:panelGroup>
												</h:form>
											</td>
											<td background="./Images/menu_m00.jpg" width="40" />
											<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
												<h:form>
												<h:commandLink class="menu" value="Mes annonces" action="CompteLogin" rendered="#{!compteLogin.connecte}">
													<f:setPropertyActionListener target="#{compteLogin.page}" value="3" />
												</h:commandLink>
												<h:panelGroup rendered="#{compteLogin.connecte}">
													<h:commandLink class="menu" value="Mes annonces" action="AnnoncesProprietairePerso" rendered="#{!compteLogin.corp}" />
													<h:commandLink class="menu" value="Mes annonces" action="AnnoncesChercheurPerso" rendered="#{compteLogin.corp}" />
												</h:panelGroup>
												</h:form>
											</td>
											<td background="./Images/menu_m00.jpg" width="40" />
											<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
												<h:form>
												<h:commandLink class="menu" value="Mon panier" action="CompteLogin" rendered="#{!compteLogin.connecte}">
													<f:setPropertyActionListener target="#{compteLogin.page}" value="4" />
												</h:commandLink>
												<h:commandLink class="menu" value="Mon panier" action="Panier" rendered="#{compteLogin.connecte}" />
												</h:form>
											</td>
											<td background="./Images/menu_d.jpg" width="21" />
										</tr>
										<tr height="20">
											<td background="./Images/menu_bg.jpg" width="22" />
											<td background="./Images/menu_b.jpg" />
											<td background="./Images/menu_bm00.jpg" width="40" />
											<td background="./Images/menu_b.jpg" />
											<td background="./Images/menu_mg.jpg" width="21" /> 
											<td background="./Images/h.jpg"/>
											<td background="./Images/menu_md.jpg" width="22" />
											<td background="./Images/menu_b.jpg" />
											<td background="./Images/menu_bm00.jpg" width="40" />
											<td background="./Images/menu_b.jpg" />
											<td background="./Images/menu_bm00.jpg" width="40" />
											<td background="./Images/menu_b.jpg" />
											<td background="./Images/menu_bd.jpg" width="21" />
										</tr>
									</table>
 								</ui:insert>
							</td>
						</tr>

						<!--  Zone page principale -->
							
						<tr>
							<td background="./Images/g.jpg" width="22" />
							<td align="center">
								
								<ui:insert name="page">
									<h:outputText value="Zone page" />
								</ui:insert>
							</td>
							<td background="./Images/d.jpg" width="21" />
						</tr>
						<tr height="23">
							<td background="./Images/bg.jpg" width="22" />
							<td background="./Images/b.jpg" />
							<td background="./Images/bd.jpg" width="21" />
						</tr>						
					</table>
				</td>
			</tr>
		</table>
	</center>
	</h:body>
</html>